package cn.ld.module.system.dal.mapper.mail;

import cn.ld.framework.common.pojo.PageResult;
import cn.ld.framework.mybatis.core.mapper.BaseMapperX;
import cn.ld.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.ld.framework.mybatis.core.query.QueryWrapperX;
import cn.ld.module.system.controller.admin.mail.vo.account.MailAccountPageInVO;
import cn.ld.module.system.dal.entity.mail.MailAccountEntity;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface MailAccountMapper extends BaseMapperX<MailAccountEntity> {

    default PageResult<MailAccountEntity> selectPage(MailAccountPageInVO pageInVO) {
        return selectPage(pageInVO, new LambdaQueryWrapperX<MailAccountEntity>()
                .likeIfPresent(MailAccountEntity::getMail, pageInVO.getMail())
                .likeIfPresent(MailAccountEntity::getUsername , pageInVO.getUsername()));
    }

}
